package com.sixmac.controller;

import com.sixmac.common.base.BaseController;
import com.sixmac.core.plugins.dao.Db;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import sun.misc.Contended;

/**
 * Created by admin on 2018/6/15.
 */
@Controller
public class IndexController extends BaseController {
    @RequestMapping("/s")
    public String index(ModelMap mm) {
        String sql1 = "select count(id)as'c' from t_user where to_days(createDate) = to_days(now())";
        String sql2 = "select count(id)as'c' from t_content where to_days(createDate) = to_days(now())";
        String sql3 = "select count(id)as'c' from t_comment where to_days(createDate) = to_days(now())";
        String sql4 = "select count(id)as'c' from t_report where to_days(createDate) = to_days(now())";
        mm.put("u_u", Db.selectOne(sql1).get("c"));
        mm.put("u_c", Db.selectOne(sql2).get("c"));
        mm.put("u_t", Db.selectOne(sql3).get("c"));
        mm.put("u_r", Db.selectOne(sql4).get("c"));
        return "main1.html";
    }

}
